ALL: default 

CC           = gcc
CLINKER      = $(CC)
OPTFLAGS     = -O0


SHELL = /bin/sh

CFLAGS  =   -DREENTRANT -Wunused -Wall -g 
CCFLAGS = $(CFLAGS)
LIBS =  -lpthread

EXECS = common.o server client

default: $(EXECS)

server: server.o common.o
	$(CLINKER) $(OPTFLAGS) -o server server.o  common.o $(LIBS)
	mv server bin/
	
client: client.o common.o
	$(CLINKER) $(OPTFLAGS) -o client client.o  common.o $(LIBS)
	mv client bin/
		
clean:
	@-/bin/rm -f *.o *~ PI* $(EXECS) *.out core 
.c:
	$(CC) $(CFLAGS) -o $* $< $(LIBS)
.c.o:
	$(CC) $(CFLAGS) -c $<
.o:
	${CLINKER} $(OPTFLAGS) -o $* $*.o $(LIBS)
